<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .grandpa {
            width: 600px;
            height: 600px;
            background-color: orangered;
        }
        .father {
            width: 400px;
            height: 400px;
            background-color: skyblue;
        }
        .grandson {
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div class="grandpa">
        <div class="father">
            <div class="grandson"></div>
        </div>
    </div>
    <script>
        const son = document.querySelector('.grandson')
        const grandpa = document.querySelector('.grandpa')
        son.addEventListener('click', () => {
            console.log('son捕获');
        })
        grandpa.addEventListener('click', () => {
            console.log('grandpa捕获');
        })
    </script>
</body>
</html>